package org.dbpt.performance;

import java.util.List;

/**
 * The class iterates it's children many times. 
 * @author Sergey Grigorchuk (sergey.grigorchuk@gmail.com)
 *
 */
public class IterationItem extends ContainerItem {
	
	private int iterationCount;

	public IterationItem() {
		super();
	}

	public IterationItem(DBPTItem child1, DBPTItem child2, DBPTItem child3) {
		super(child1, child2, child3);
	}

	public IterationItem(DBPTItem child1, DBPTItem child2) {
		super(child1, child2);
	}

	public IterationItem(DBPTItem child) {
		super(child);
	}

	public IterationItem(List<DBPTItem> children) {
		super(children);
	}

	public int getIterationCount() {
		return iterationCount;
	}

	public void setIterationCount(int iterationCount) {
		this.iterationCount = iterationCount;
		setMeasureValue(iterationCount);
	}

	@Override
	public void doIteration() {
		for(int i = 0; i < iterationCount; i++) {
			super.doIteration();
		}
	}
}
